package com.seed.bpmn.engine;


import com.seed.bpmn.engine.dto.ProcessInstanceDTO;
import com.seed.bpmn.engine.dto.TaskDTO;

import java.util.List;

/**
 * 流程流转相关服务接口
 *
 * @author cscz89@126.com
 */
public interface IBPMNHistoryService {

    /**
     * 通过流程实例ID获取历史级别流程实例
     * @param processInstanceId 流程实例ID
     * @return
     * @throws Exception
     */
    public ProcessInstanceDTO getProcessInstance(String processInstanceId) throws Exception;

    /**
     * 通过业务数据ID获取历史级别流程实例
     * @param businessKey 业务数据ID
     * @return
     * @throws Exception
     */
    public ProcessInstanceDTO getProcessInstanceByBusinessKey(String businessKey) throws Exception;

    /**
     * 获取办结状态流程实例
     * @param processInstanceId 流程实例ID
     * @return
     */
    public ProcessInstanceDTO getFinishProcessInstance(String processInstanceId);

    /**
     * 通过任务id查询历史级别任务
     * @param taskId 任务ID
     * @return
     * @throws Exception
     */
    public TaskDTO getTask(String taskId) throws Exception;

    /**
     * 通过流程实例Id查询历史级别任务
     * @param processInstanceId 流程实例ID
     * @throws Exception
     */
    public List<TaskDTO> findTaskByProcessInstanceId(String processInstanceId) throws Exception;
}
